
import java.io.*;




class Robot777 extends Thread {

	public Robot777 r777 = null ; 
	
	public Robot777() {
	}

	public Robot777( Robot777 r777) {
		this.r777 = r777;
	}

	public void run() {

		try {
			
			int sayac = 0 ;
			while (true) {

				if ( (sayac % 10000000) == 0) {
					System.out.println(this.getName()+"-->"+sayac);
				} 

				if ( (sayac == 30000000) && this.getName().equals("Thread-1") ) {
					
					//this.sleep(1000000);
					// G/C (I/O)
					System.out.println("Ltf sayi giriniz");
					BufferedReader a = new BufferedReader( new InputStreamReader(System.in) );
					System.out.println("-->" + a.readLine() );

					//this.interrupt();
				}

				if ( (sayac == 0) && this.getName().equals("Thread-2") ) {
				    r777.interrupt(); // Thread-1 interrupt
				}

			   sayac++;
			}

		} catch (Exception ex) {
			System.out.println("Hata olustu -->"+ ex);
		}
	}
}

public class Ornek777 {

	public static void main(String args[]) throws Exception{

		Robot777 r1 = new Robot777();
		Robot777 r2 = new Robot777(r1);
		Robot777 r3 = new Robot777();
		
		r1.setPriority(7);
		r2.setPriority(7);
		r3.setPriority(3);

		r1.start();
		r2.start();
		r3.start();
	}
}
